package com.damon.authority.dal.entity;

import com.kylin.shared.common.entity.BaseEntry;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 权限系统的角色数据项
 * @author Damon S.
 * @version v1.0.1
 * @date 2019年11月01日 10:57
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_platform_role", catalog = "db_kylin_artwork")
public final class RoleEntry extends BaseEntry implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", unique = true)
    private Long roleId;

    /** 角色编码 如：R0001，R10002……*/
    @Column(length = 16)
    private String code;

    /** 角色名称 */
    @Column(length = 64)
    private String name;

    /** 该角色允许的用户数量0:不限，取值≥0 */
    @Column private Integer limitation;

    /** 区分不同系统 */
    @Column(length = 16)
    private String catalog;

    /** 状态：正常，冻结 */
    @Column private Integer state;
}
